Socket
Socket
Sign inDemoInstall

@paprika/raw-button

Package Overview
Dependencies
92
Maintainers
5
Versions
71
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @paprika/raw-button

Raw button component, for performing an action on the page you’re viewing.


Version published
Weekly downloads
8.9K
decreased by-25%
Maintainers
5
Created
Weekly downloads
 

Readme

Source

@paprika/raw-button - 0.2.21

Description

Raw button component, for performing an action on the page you’re viewing.

Installation

yarn add @paprika/raw-button

or with npm:

npm install @paprika/raw-button

Props

RawButton

PropTyperequireddefaultDescription
a11yTextstringfalsenullDescriptive a11y text for assistive technologies. By default, text from children node will be used.
canPropagateboolfalsetrueIf click events are allowed to propagate up the DOM tree.
childrennodetrue-Body content of the button.
hasInsetFocusStyleboolfalsefalseIf the visual focus ring should be displayed with an inset style.
isActiveboolfalsenullIf the button is in an "active" or "selected" state.
isDisabledboolfalsefalseIf the button is disabled.
onClickfuncfalse() => {}Callback to be executed when the button is clicked or activated by keyboard. Typically required.
rolestringfalse"button"Value for role attribute to override the default of "button".
tabIndexnumberfalsenullValue for tabindex attribute to override the default of 0.

RawButton

The <RawButton> component is a fully accessible button, rendered with almost no styling as a generic <span> element. It is intended for use any time click actions are needed for a UI element that is not visually represented as a skeuomorphic button.

For accessibility, the role="button", tabIndex="0", and aria-disabled="false" attributes are added by default, but can be overridden. An aria-label can be included via the a11yText prop, a visual focus ring is applied, and keyboard listeners are included that will fire the onClick function when the user activates the component with an enter or space keypress.

Usage

import RawButton from "@paprika/raw-button";

<RawButton onClick={clickHandler}>Visible click target</RawButton>;
  • Storybook showcase
  • Github source code
  • Github create issue
  • ChangeLog

FAQs

Last updated on 09 Nov 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc